<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .color {
        color: red;
    }
    
    .list {
        display: none;
    }
</style>

<body>
    <div id="app">
        <div class="wrap">
            <!-- :class="flag ? 'color' : ''"  -->
            <a href="#" @mouseover="over" @mouseout="out" :style="{color:flag?'red':''}">手机京东</a>
            <!-- :class="!flag ? 'list' : '' " -->
            <ul :style="{display:!flag?'none':''}">
                <li>无序列表1</li>
                <li>无序列表2</li>
                <li>无序列表3</li>
                <li>无序列表4</li>
                <li>无序列表5</li>
            </ul>
        </div>
    </div>
</body>

</html>
<script src="js/vue3.4.21.js"></script>
<script>
    const {
        createApp,
        ref
    } = Vue
    createApp({
        setup() {
            const flag = ref(false)

            function over() {
                flag.value = true
            }

            function out() {
                flag.value = false
            }
            return {
                over,
                out,
                flag
            }
        }
    }).mount("#app")
</script>